package com.zm.zb100.controller;

import com.zm.zb100.persistence.entity.db.User;
import com.zm.zb100.repository.UserRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Test
 *
 * <p>
 * </p>
 *
 * @author chuanbai
 * @date 2024/6/14
 */
@RestController
public class Test {

    @Resource
    private UserRepository userRepository;

    @GetMapping("/aaa")
    public List<User> test(){
        Pageable pageable = PageRequest.of(0, 10, Sort.by(Sort.Order.desc("ema_il")));
        Page<User> test = userRepository.findTest(pageable);
        return test.getContent();

    }
}
